package mc

import (
	"gitee.com/dreamwood/ez-go/db/mgo"
)

const (
	ComSnLogEventNew          = "tool.ComSnLogNew"
	ComSnLogEventBeforeCreate = "tool.ComSnLogBeforeCreate"
	ComSnLogEventBeforeUpdate = "tool.ComSnLogBeforeUpdate"
	ComSnLogEventBeforeSave   = "tool.ComSnLogBeforeCreate tool.ComSnLogBeforeUpdate"
	ComSnLogEventAfterCreate  = "tool.ComSnLogAfterCreate"
	ComSnLogEventAfterUpdate  = "tool.ComSnLogAfterUpdate"
	ComSnLogEventAfterSave    = "tool.ComSnLogAfterCreate tool.ComSnLogAfterUpdate"
	ComSnLogEventDelete       = "tool.ComSnLogDelete"
)

func GetComSnLogConfig() *mgo.DocConfig {
	return ComSnLog_Config
}

var ComSnLog_Config *mgo.DocConfig

func init() {
	ComSnLog_Config = NewComSnLogConfig()
}
func NewComSnLogConfig() *mgo.DocConfig {
	return &mgo.DocConfig{
		ContainerKey: "tool.ComSnLog",
		Fields: []string{
			"sn", "type", "value", "typeValue",
		},
		RelationFields: []string{
			"sn",
		},
		RelationConfigs: map[string]*mgo.DocRelation{
			"sn": {
				Config:     GetComSnConfig,
				DocName:    "ComSn",
				JoinType:   "O",
				KeyInside:  "snId",
				KeyOutSide: "id",
			},
		},
		FieldFilter: map[string]*mgo.DocFieldFilter{
			"default": {
				Select: []string{},
				Omit:   []string{},
			},
		},
	}
}
